apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  labels:
    k8s-app: coredns-etcd
  name: coredns-etcd
  namespace: external-dns
spec:
  replicas: 1
  selector:
    matchLabels:
      k8s-app: coredns-etcd
  template:
    metadata:
      annotations:
        scheduler.alpha.kubernetes.io/critical-pod: ""
      labels:
        k8s-app: coredns-etcd
    spec:
      tolerations:
      - key: CriticalAddonsOnly
        operator: Exists
      - effect: NoSchedule
        key: node-role.kubernetes.io/master
      containers:
      - name: coredns-etcd
        image: quay.io/coreos/etcd:{{ single_etcd_version }}
        command: ["/usr/local/bin/etcd"]
        args:
        - --listen-client-urls=http://0.0.0.0:{{ ETCD_PORT }}
        - --advertise-client-urls=http://0.0.0.0:{{ ETCD_PORT }}
        - --data-dir=/var/lib/etcd
        livenessProbe:
          failureThreshold: 5
          tcpSocket:
            port: {{ ETCD_PORT }}
          initialDelaySeconds: 60
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 5
        ports:
        - name: etcd-http
          containerPort: {{ ETCD_PORT }}
          protocol: TCP
        - name: etcd-peer
          containerPort: {{ ETCD_PEER_PORT }}
          protocol: TCP
        resources:
          limits:
            cpu: 500m
            memory: 512Mi
          requests:
            cpu: 100m
            memory: 128Mi
        volumeMounts:
        - name: etcd-data
          mountPath: /var/lib/etcd
      volumes:
      - name: etcd-data
        hostPath:
          path: {{ coredns_etcd }}
          type: DirectoryOrCreate
